#!/bin/bash
# Check for warp_home
if [ -z "$WARP3D_HOME" ]; then
   printf "[ERROR]\n"
   printf "... Environment variable WARP3D_HOME is not set.\n"
   printf "Quitting...\n"
   exit 1
fi
#
# verify ifort is available
#
   hash ifort 2>&- || {
         printf "[ERROR]\n"
         printf "... Cannot find the Intel Fortran compiler (ifort) in your PATH.\n"
         printf "... See Intel Fortran install documentation. Most often a line of\n"
         printf "... the form: source /opt/intel/composerxe/... is placed\n"
         printf "... in the /etc/bashrc file on your Mac.\n"
         printf "Quitting...\n\n"
         exit 1
   }
# cd here
cd $WARP3D_HOME/pat_combine

ifort -w -O2 -openmp -traceback pat_combine.f -o z
cd ../run_linux_em64t
/bin/rm -rf pat_combine.go &> /dev/null
mv ../pat_combine/z ./pat_combine.go
chmod ugo+rwx pat_combine.go
